<template>
	
	<h1>积分规则</h1>
	<editor-wang :value="content" @change="changeWang"></editor-wang>
	<el-button size="large"  type="primary" @click="submit">确定</el-button>
</template>


<script >

			


	
	import moment from "moment"
	import editorWang from '../components/wangEnduit'
	import {
		ElMessageBox,
		ElMessage
	} from 'element-plus'
	export default {
		components:{
			editorWang
		},
		
		data() {
			return {
				content:""
			}
		},
		mounted() {
			this.getData();		
		},
		methods: {
			
			
			addhj(){
				this.hjarr.push([]);
			},
			scwei(wei,id){
				console.log(wei)
				if(this.qrcode){
					this.qrcode.clear(); 
				}
				this.modalStatecode=true;
				this.$nextTick(()=>{
					this.creatQrCode(JSON.stringify({wei,id})); 
				})
				
				
			},
			edites(data){
				console.log(data.row)
				data.row.is_show=data.row.is_show+'';
				delete data.row.ewmid;
				var data =JSON.parse(JSON.stringify(data.row))
				this.times=[data.starttime,data.endtime];	
			},
			changeWang(html) {
				this.content=html;
			    console.log(html)
			},
            
			getData() {
				this.$http.get("/index.php/index/Hdbm/fxnfhdtwedit").then(data => {
					
					this.content=data[0].content;

				})
			},
			submit(ref) {
				this.$http.post('/index.php/index/Hdbm/fxnfhdtwedit' ,
					{content:this.content}).then(data => {
					console.log(data)
					this.modalState = false;
					ElMessage({
						message: '编辑成功',
						type: 'success',
					})
					this.getData();
				})
				
			},
			remove(data){
				this.$http.post("/index.php/index/Userinfo/hddel",{id:data.row.id}).then(data => {
					ElMessage({
						message: '删除成功' ,
						type: 'success',
					})
					this.getData();
				})
			},
			handleAvatarSuccess(file) {

				this.form.image = file.data;
			},
			


		}
	}
</script>
